import request from '@/utils/request'

/**
 * 部门分页查询
 * @param {查询条件} data
 */
export function getDepartPageList(data) {
  return request({
    url: 'baseFrame/depart/pageList',
    method: 'post',
    data: data,
  })
}

export function getDepartTreeSelectList(data){
    return request({
        url: 'baseFrame/depart/treeSelectList',
        method: 'post',
        data: data,
    })
}



/**
 * 新增部门
 * @param data
 */
export function addDepart(data) {
  return request({
    url: 'baseFrame/depart/add',
    method: 'post',
    data: data,
  })
}

/**
 * 修改部门
 * @param data
 */
export function modifyDepart(data) {
  return request({
    url: 'baseFrame/depart/modify',
    method: 'post',
    data: data,
  })
}

export function changeDepartState(data) {
    return request({
        url: 'baseFrame/depart/changeState',
        method: 'post',
        data: data,
    })
}


/**
 * 获取部门详情
 * @param {Id}
 */
export function getDepartDetail(id) {
  return request({
    url: 'baseFrame/depart/detail/' + id,
    method: 'get'
  })
}

/**
 * 删除部门
 * @param {主键} pid
 */
export function delDepart(data) {
  return request({
    url: 'baseFrame/depart/delete',
    method: 'post',
    data:data
  })
}

